import { createRouter, createWebHistory } from 'vue-router'
import vmain from '../components/main/main.vue'

const routes = [{
        path: '',
        redirect: '/loginmain'
    },
    {
        path: '/login',
        name: 'login',
        component: () =>
            import ('../components/login/login.vue')
    },
    {
        path: '/loginmain',
        name: 'loginmain',
        component: () =>
            import ('../components/login/loginmain.vue')

    },

    {
        path: '/yunyin',
        name: 'yunyin',
        component: () =>
            import ('../yunyin'),
        children: [{
                path: 'vmain',
                name: 'vmain',
                component: vmain
            },
            {
                path: 'sheet',
                name: 'sheet',
                // route level code-splitting
                // this generates a separate chunk (about.[hash].js) for this route
                // which is lazy-loaded when the route is visited.
                component: () =>
                    import ( /* webpackChunkName: "about" */ '../components/sheet/sheet.vue')
            },
            {
                path: 'search',
                name: 'search',
                component: () =>
                    import ('../components/search/search.vue'),
            },
            {
                path: 'white',
                name: 'white',
                component: () =>
                    import ('../components/search/white.vue')
            },
            {
                path: 'white2',
                name: 'white2',
                component: () =>
                    import ('../components/asong/white2.vue')
            },
            {
                path: 'asong',
                name: 'asong',
                component: () =>
                    import ('../components/asong/asong.vue')
            },
            {
                path: 'command',
                name: 'command',
                component: () =>
                    import ('../components/asong/command.vue')
            },
            {
                path: 'list',
                name: 'list',
                component: () =>
                    import ('../components/list/list.vue')
            },
            {
                path: 'user',
                name: 'user',
                component: () =>
                    import ('../components/user/user.vue')
            },
            {
                path: 'find',
                name: 'find',
                component: () =>
                    import ('../components/find/find.vue')
            },


        ]
    },

]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router